<?php

namespace app\wap\controller;

use app\common\model\AdPosition;

class Ad extends Base
{
    /**
     * getIndexTop #获取首页顶部的广告
     * api post /{controller}/{method}
     * @param int limit 显示几个(默认5个)
     *
     * @auth kouweihong
     * @date 2020/12/3
     */
    public function getIndexTop()
    {
        $limit = input('limit', 5);
        $where = ['status' => \app\common\model\Ad::STATUS_0, 'position_id' => AdPosition::POSI_ID_WAP_INDEX_TOP];
        $list = \app\common\model\Ad::where($where)->limit(5)->select();

        $this->success($list);
    }
}
